<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <style>
    /**实现div在父元素中垂直居中**/
    .box {
      width: 100%;
      height: 500px;
      color: white;
      background: yellow;
      display: flex;
      flex-direction: column;
      align-items: center;
    }
    .box div {
      width: 500px;
      height: 100px;
    }
  </style>
</head>
<body>
  <div class="box">
    <div class="child-1" style="background: red;">测试1</div>
    <div class="child-2" style="background: blue;">测试2</div>
    <div class="child-3" style="background: green;">测试3</div>
  </div>
</body>
</html>